package com.payment.ktb.activity.main4;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import com.payment.ktb.Fragment.FragmentProfitManageProfitDetail;
import com.payment.ktb.Fragment.FragmentProfitManageProfitSum;
import com.payment.ktb.R;
import com.payment.ktb.activity.BaseActivity;
import com.payment.ktb.adapter.FragmentAdapterProfitManage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by admin on 2017/12/4.
 */

public class ProfitManageActivity extends BaseActivity {


    @BindView(R.id.vp_profitmanage)
    ViewPager vp_profitmanage;
    @BindView(R.id.tl_profitmanage)
    TabLayout tl_profitmanage;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profitmanage);
        ButterKnife.bind(this);
        initTitle("分润管理");
        initData();
        tl_profitmanage.setupWithViewPager(vp_profitmanage);
    }

    private void initData(){


        Fragment fragmentProfitDetail = new FragmentProfitManageProfitDetail();
        Fragment fragmentProfitSum = new FragmentProfitManageProfitSum();
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(fragmentProfitDetail);
        fragments.add(fragmentProfitSum);

        String[] mTitle = new String[]{"分润明细", "日分润汇总"};

        FragmentAdapterProfitManage adapter = new FragmentAdapterProfitManage(getSupportFragmentManager(),fragments, Arrays.asList(mTitle));
        vp_profitmanage.setAdapter(adapter);
    }
}
